/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package server.managerServer.executors;
import protocol.Executor;
import protocol.*;
import protocol.ThreadWorker;
import server.managerServer.ServerWorker;

/**
 *
 * @author radu
 */
public class ExecutorConnect extends Executor {
    MessageConnectReq msg;
    
    public ExecutorConnect(Message _msg){
        super(_msg);
        msg = (MessageConnectReq) _msg;
    }

    @Override
    public void doWork(ThreadWorker worker) {
        ServerWorker serverWorker = (ServerWorker) worker;
        String email = msg.getEmail();
        
        serverWorker.setAdminEmail(email);
        
        serverWorker.sendMessage(new MessageConnectRep(true));       
    }
    
}